<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<sec:authentication property="principal" var="currentPrincipal" scope="page" />

<fmt:setBundle basename="ApplicationMessage" />
<fmt:setLocale value="zh_CN" />

<!DOCTYPE html>
<html lang="zh-CN">
<head>

<%@ include file="/WEB-INF/include/meta.jsp"%>
<%@ include file="/WEB-INF/include/css.jsp"%>

</head>

<body class="ms-theme-blue">

    <%@ include file="/WEB-INF/include/header.jsp"%>
    <%@ include file="/WEB-INF/include/submenu.jsp"%>

    <div class="container-fluid ms-container has-ms-sidemenu">

        <ol class="ms-breadcrumb breadcrumb">
            <li class="active">基础数据&nbsp;-&nbsp;汇率管理</li>
        </ol>

        <div class="ms-content-layout">
            <div class="x-operation-bar no-margin no-bottom-border clearfix">

                <ul class="nav nav-tabs ms-nav-tabs" role="tablist">
                    <li role="presentation" class="active"><a href="${ctx.host}/currencies?isCurrent=true">当前汇率</a></li>
                    <li role="presentation" ><a href="${ctx.host}/currencies?isCurrent=false">汇率列表</a></li>
                </ul>
                  <table class="table table-hover ms-table">
                  <thead>
                    <tr>
                      <th>序号</th>
                      <th>货币名称</th>
                      <th>货币符号</th>
                      <th>货币代码</th>
                      <th>最后更新时间</th>
                      <th>汇率</th>
                      <th>录入人</th>
                      <th>创建时间</th>
                    </tr>
                  </thead>

                    <tbody>
                        <c:forEach items="${exchangeRates}" var="exchangeRate" varStatus="status">
                            <tr>
                                <td>${status.index+1}</td>
                                <td>${exchangeRate.currencyName}</td>
                                <td>${exchangeRate.currencySymbol}</td>
                                <td>${exchangeRate.currencyCode}</td>
                                <td><fmt:formatDate value="${exchangeRate.effectiveTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                                <td>${exchangeRate.rate}</td>
                                <td>${persist.principal(exchangeRate.operator).name}</td>
                                <td><fmt:formatDate value="${exchangeRate.createTime}" pattern="yyyy-MM-dd HH:mm:ss" /></td>
                            </tr>
                        </c:forEach>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <%@ include file="/WEB-INF/include/footer.jsp"%>
    <%@ include file="/WEB-INF/include/script.jsp"%>
    <d:resource type="script" root="${ctx.resource}/build" src="js/page/data/current.js" />
    <script type="text/javascript">
        require([ 'page/data/current-list' ], function(page) {
            page.init()
        })
    </script>

</body>
</html>